import { getDictList } from "@/utils/cacheUtil";
import { alarmParam } from "@/utils/constants";
export interface IAlarmParam {
	value: number | boolean | string;
	label: string;
}
export const useAlarmMode = (val: number) => {
	return Object.values(alarmParam.warningMode).find(item => item.value == val) || {};
};
export const useAlarmLevel = async (val: number) => {
	return (await getDictList("warning_level")).find((item: any) => item.key == val) || {};
};
export const useError = (val: number) => {
	return Object.values(alarmParam.isError).find(item => item.value == val) || {};
};
export const useAutoDone = (val: boolean) => {
	return Object.values(alarmParam.autoDone).find(item => item.value == val) || {};
};
export const useTriggerTyp = (val: number) => {
	return Object.values(alarmParam.triggerType).find(item => item.value == val) || {};
};
